package com.kyjszj.modules.product.controller;

import com.kyjszj.modules.product.entity.Product;
import com.kyjszj.modules.product.service.IProductService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("${default.url.prefix}/product")
@Api(value="productRest",description="商品管理",tags="ProductController")
public class ProductController  {

    @Autowired
    private IProductService productService;

    @RequestMapping("/detail/{id}")
    public String detail(@PathVariable String id, ModelMap modelMap){
       Product product= productService.selectById(id);
        modelMap.put("product",product);
        return "/f/product/detail";
    }

}
